﻿Public Class dTarjetaCredito 

    Private Sub PagotarjetacreditoBindingNavigatorSaveItem_Click(sender As System.Object, e As System.EventArgs) Handles PagotarjetacreditoBindingNavigatorSaveItem.Click
        Me.Validate()
        Me.PagotarjetacreditoBindingSource.EndEdit()
        Me.TableAdapterManager.UpdateAll(Me.DbFireAndIceDataSet)

    End Sub

    Private Sub dTarjetaCredito_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'DbFireAndIceDataSet.pagotarjetacredito' table. You can move, or remove it, as needed.
        Me.PagotarjetacreditoTableAdapter.Fill(Me.DbFireAndIceDataSet.pagotarjetacredito)
        BindingNavigatorAddNewItem.PerformClick()
        tmontopago.EditValue = My.Forms.frmPagarFactura.tmonto.EditValue
        'IdfacturaspagoTextBox.Text = Me.FacturaspagoTableAdapter1.ScalarQueryUltimoIdFacturasPago()
    End Sub

    Private Sub btGuardar_Click(sender As System.Object, e As System.EventArgs) Handles btGuardar.Click
        Try
            If NumtarjetaTextBox1.Text = "" Then
                ErrorProvider1.SetError(NumtarjetaTextBox1, "Ingrese el número de tarjeta.")
            Else
                ErrorProvider1.SetError(NumtarjetaTextBox1, Nothing)

                PagotarjetacreditoBindingNavigatorSaveItem.PerformClick()
                Me.Close()
            End If
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub

End Class